#!/bin/bash 

source ./test.cfg

DEBUG=0

if [ -z $1 ]; then
  NODE=msserver01a
  ID=APP1
  TOPIC=\$SharedSubscription/dog//APP/a01/#
else
  NODE=${APPLIANCE[$1]}
  ID=${APP[$1]}
  TOPIC=${SHARED}/APP/${ID}/#
fi

ID=C00000010
PW=svtpvtpass
ENDPOINT=`/niagara/test/scripts/getclusterserverendpointport.py -c ${CLUSTER} -e SVT-IntranetEndpoint -a ${NODE}`
gathersubserver=tcp://${ENDPOINT}

if [ ${DEBUG} -ne 0 ]; then
  echo CLUSTER=${CLUSTER}
  echo NODE=${NODE}
  echo ENDPOINT=${ENDPOINT}
  echo QOS=${QOS}
  echo MESSAGES=${MESSAGES}
fi


echo test_template5_MQTTClient -a subscribe -mqtt 3.1.1 -t /svtGroup0/chat/gather -s ${gathersubserver} -i u0000010 -v -q 2 -c false -u u0000010 -p imasvtest -n 4000 -gather -O -sharedsubscribers 2  -debug

echo java svt.mqtt.mq.MqttSample -a subscribe -mqtt 3.1.1 -t /svtGroup0/chat/gather -s ${gathersubserver} -i ${ID} -v -q ${QOS} -c false -u ${ID} -p ${PW} -n ${GMESSAGES} -gather ${ORDER} -sharedsubscribers 2  -debug
java svt.mqtt.mq.MqttSample -a subscribe -mqtt 3.1.1 -t /svtGroup0/chat/gather -s ${gathersubserver} -i ${ID} -v -q ${QOS} -c false -u ${ID} -p ${PW} -n ${GMESSAGES} -gather ${ORDER} -sharedsubscribers 2  -debug


